import MarkdownIt from 'markdown-it'

export function useMarkdown() {
  const md = new MarkdownIt({
    html: true,
    breaks: true,
    linkify: true
  })

  const renderMarkdown = (content: string): string => {
    if (!content) return ''
    return md.render(content)
  }

  return {
    renderMarkdown
  }
}